/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ClientGui;
import clientData.PostData;
import clientData.TopicData;
import javax.swing.*;
import java.awt.Color;
import java.awt.Component;
/**
 *
 * @author iziko
 */
public class PostCellRenderer extends JLabel implements ListCellRenderer {

    public PostCellRenderer() {
            setOpaque(true);
        }
         public Component getListCellRendererComponent(
         JList list,
         Object value,
         int index,
         boolean isSelected,
         boolean cellHasFocus)
     {
         setText(((PostData)value).getTitle());
        setBackground(isSelected ? Color.CYAN: Color.white);
        setForeground(isSelected ? Color.black : Color.black);
         return this;
     }
}
